package colleaction.sort;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class TestItemSort {

	public static void main(String[] args) {
		Item item1 = new Item(1001, 10);
		Item item2 = new Item(1001, 8);
		Item item3 = new Item(1000, 1);

		List<Item> items = new ArrayList<Item>();
		items.add(item1);
		items.add(item2);
		items.add(item3);

		print(items);

		Collections.sort(items, new ItemComparetor());
		print(items);
	}

	public static void print(List<Item> items) {
		for (Item item : items) {
			System.out.println(item);
		}
		System.out.println("=======================================");
		System.out.println();
	}
}
